<!--{template admin/header}-->
<body id="homepage">
    <div id="breadcrumb">
        <ul>
            <li><img src="static/img/icons/icon_breadcrumb.png"
                     alt="Location" /></li>
            <li><strong>位置:</strong></li>
            <li><a href="admin.php">主页</a> - 点滴话题</li>
        </ul>
    </div>
    <div id="rightside" >
        <div class="contentcontainer">
            <div class="headings altheading">
            <h3><span class="nav_left"> 点滴话题</span></h3>
			  </div>
                <div class="paper-head"> 
                <p>
                	<ul class="inline">
	 					 <li>
	 					 	<a href="admin.php?ac=diaryTopicOfficial&type=all"><button class="btn btn-primary">全部话题</button></a>
	 					 </li>
						 <li>
							<form action="admin.php"  class="form-inline"  method='get'>								  													
									<div class="input-prepend">
										<span class="add-on">搜索点滴话题</span>
										<input class="span2" id="prependedInput" type="text" placeholder="name" name="name">
									</div>																			   
							   		
							   		<div class="input-prepend">
								   		<input type="hidden" name="ac" value="diaryTopicOfficial"/>
								   		<input type="hidden" name="op" value="searchDiaryTopic"/>
									    <button class="btn btn-primary" type="submit">确认</button>
								    </div>	
						 	</form>
						</li>
						<li>
							<form method="get" class="form-inline" role="form" action="admin.php">                      
		                   	<!--{if $param[type]!=1}-->
		                   		<select name='sort' class="span2" >      
			                   		<option value="" >默认按时间排序</option>                		
			                        <option value="hot"  {$sort[hot]}>按热度排序</option>			                                             
		                        </select>  
		                     <!--{/if}-->
		                        <select name='length' class="span2" >      
			                   		<option value="50"  {$page_len[50]}>每页显示50条</option>                		
			                        <option value="100" {$page_len[100]}>每页显示100条</option>                       
				                </select>                     
		                        <input type="hidden" name="ac" value="diaryTopicOfficial" />  
		                        <input type="hidden" name="type" value="{$param[type]}" />                     
                       			<button type="submit" class="btn btn-large" name="sub"> 点击查询 </button>
                   		    </form>           
						</li>
						</ul> 
				</p>						  
						 <!--<form action="admin.php" method='get'>
							<div class="modal-header">
								&nbsp;
							</div>												
							<div class="input-prepend">
								<span class="add-on">点滴话题ID</span>
								<input class="span2" id="prependedInput" type="text" placeholder="name" name="id">
							</div>																			   
					   		
					   		<div class="input-prepend">
						   		<input type="hidden" name="ac" value="diaryTopicOfficial"/>
						   		<input type="hidden" name="op" value="editDiaryTopicType"/>
							    <button class="btn btn-primary" type="submit">确认</button>
						    </div>	
						  </form>--> 										    	  
				</div>
      		    
      
      		  <div class="contentbox">
                <table width="100%" class="table table-striped">
                    <thead>
                        <tr>
                        	<th>话题ID</th>
                        	<th>话题名</th>   
                            <th>创建者</th>                                         
                            <th>热度(百分比)</th>                                         
                            <th>类型</th>
                            <th>状态</th>
                            <th>创建时间</th>
                            <th>操作</th>                        
                        </tr>
                    </thead>
                    
                    <tbody>
                  		<!--{if $result != '' }-->
                        <!--{loop $result $value}-->
                        <tr>                
                        	<td><!--{$value[id]}--></td>
                        	<td><b><a  target="_blank" href="admin.php?ac=diaryTopicOfficial&op=getDiarysByTopic&gid={$value[id]}"><!--{$value[name]}--></b></td>                             
                            <td><a href="admin.php?ac=user_profile&uid={$value[uid]}"><!--{$value[user][nickname]}--></td>                                                  
                            <td><!--{$value[hot]}--></td>                            
                            <td>
                            	<!--{if $value[type] == 0}-->
                            		普通
                            	<!--{/if}-->
                            	<!--{if $value[type] == 1}-->
                            		热门
                            	<!--{/if}-->
                            	
                            </td>     
                            <td>
							<!--{if $value[status] == 3}-->
								已删除
							<!--{else}-->
								已通过
							<!--{/if}-->
							</td>                                              
							<td><!--{date('Y-m-d H:i:s',$value[time])}--></td>
						
                            <td> 
                            <!--{if $value[type]==1}-->                          
	                            <span class="nav_right"><a href="#editDiaryTopicInfo{$value[id]}" role="button" class="btn btn-primary btn-middle" data-toggle="modal">编辑</a></span>
									<div id="editDiaryTopicInfo{$value[id]}" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel_editDiaryTopicInfo" aria-hidden="true" style="width:443px">
									<form  action="admin.php" method='get'>
										<div class="modal-header">
											<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
											<h3>编辑点滴话题</h3>
										</div>
										<div class="modal-body nav-category" style="max-height:800px;">							
											<div class="input-prepend">
												<span class="add-on">话题</span>
												<input class="span4"  type="text" value="{$value[name]}"  name="name" readonly>
											</div>	
											<div class="input-prepend">
												<span class="add-on">类型</span>
												      <select name='type' class="span4" >		
														<!--{if $value[type] == 1}-->												
														<option value="1"  selected>热门</option>											
														<option value="0" >普通</option>												
													    <!--{else}-->
													    <option value="1"  >热门</option>											
														<option value="0" selected>普通</option>		
													    <!--{/if}-->																					
                      						            </select>    
											</div>
											<div class="input-prepend">
												<span class="add-on">热度</span>
												<input class="span4"  type="text" value="{$value[hot]}"  name="hot" >
											</div>
											<div class="input-prepend">
												<span class="add-on">背景</span>
												<input class="span4"  type="text" value="{$value[img_small]}"  name="img_small" >
											</div>
											<div class="input-prepend">
												<span class="add-on">banner图</span>
												<textarea class="span4"  type="text"  name="banner" >
														 <!--{$value[banner]}-->
												</textarea>
											</div>	
											<div class="input-prepend">
												<span class="add-on">action</span>
												<textarea class="span4"  type="text"  name="action" >
														 <!--{$value[action]}-->
												</textarea>
											</div>	
																									
									   </div>
									   <div class="modal-footer">
									   		<input type="hidden" name="ac" value="diaryTopicOfficial"/>
									   		<input type="hidden" name="op" value="editDiaryTopicInfo"/>
									   		<input type="hidden" name="id" value="{$value[id]}"/>
										    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
										    <button type="submit" id="submit" class="btn btn-primary">马上更改</button>
									   </div>
									  </form>
									</div>	 
								<!--{else}-->									
	                           			<a href="admin.php?ac=diaryTopicOfficial&op=editDiaryTopicType&id={$value[id]}&hot={$value[hot]}" >
											<button class="btn btn-primary btn-middle">
	                           					设置热门
	                           	  			 </button>
										</a>
								<!--{/if}-->                          	                            	                            
	                            	<a href="admin.php?ac=diaryTopicOfficial&op=deleteDiaryTopic&gid={$value[id]}&type={$value[type]}" ><button class="btn btn-primary btn-middle">
	                           			删除
	                           	   </button></a>
                            </td>
                        </tr>
                        <!--{/loop}-->
                    <!--{/if}-->
                    </tbody>
                
                </table>                              
                <div style="clear: both;"></div>
            </div>  		
      
            <!--{if $_GET['op'] != searchDiaryTopic}-->
             <div class="extrabottom">
                    <div class="bulkactions">
                        <ul class="pagination">
                            <!--{if $prevpurl!=''}-->
                            <li class="text"><a href="{$firstpurl}" title="">首页</a></li>
                            <li class="text"><a href="{$prevpurl}" title="">上一页</a></li>
                            <!--{/if}-->                       
                            <li class="text"><a href="{$nextpurl}" title="">下一页</a></li>
                        </ul>
                        <div style="clear: both;"></div>
                    </div>
             </div>
             <!--{/if}-->
        </div>
    </div>
    <!--{template admin/leftside}-->
    <!--{template admin/footer}-->
    